<template>
	<view>
		<uni-nav-bar left-icon="back" left-text="返回" :border="false" title="申请记录"
		 status-bar fixed @clickLeft="backLastPage"
		></uni-nav-bar>
		<view style="height: 12rpx; border: solid 1rpx #E3E3E3; background-color: #F2F6F9;"></view>
		<block v-for="(item, index) in recordsList" :key="index">
			<view class="px-3">
				<view class="flex justify-between">
					<text class="">{{ item.sbName }}</text>
					<text class="">{{ item.sbIdcard }}</text>
				</view>
				<view class="flex justify-between">
					<text class="">{{ item.sbSex }}</text>
					<text class="">{{ item.sbPhone }}</text>
				</view>
				<view class="flex justify-between ">
					<text class="">{{ item.sbSensus }}</text>
					<text class="">{{ item.procApplyTime }}</text>
				</view>
			</view>
			<view v-if="recordsList.length-1 !== index"
			 style="height: 24rpx; border: solid 1rpx #E3E3E3; background-color: #F2F6F9;"></view>
		</block>
		<view style="height: 12rpx; border: solid 1rpx #E3E3E3; background-color: #F2F6F9;"></view>
	</view>
</template>

<script>
	import uniNavBar from '@/components/uni/uni-nav-bar/uni-nav-bar.vue';
	import {Decrypt,Encrypt} from '@/common/util/crypto.js';
	
	export default {
		components: {
			uniNavBar,
		},
		data() {
			return {
				recordsList: [], 
				pagingParameter: {
					page: 1, // 当前页数
					limitStrip: 10 // 限制条数
				},
				queryParameter: {
					"processKey": "",
					"processState": "",
					"processCurrNodeUserId": "",
					"userId": "",
					"processId": null,
					"departmentId": null,
					"username": null,
					"procApplyTime": null
				}
			}
		},
		async onLoad () {
			const res = await this.$api.ProcessInstanceList(
			 `/${this.pagingParameter.page}/${this.pagingParameter.limitStrip}`, this.queryParameter);
			if (res.data.code === 200) {
				// const result = Decrypt(res.data.result);
				const result = res.data.result;
				for (let i = 0; i < result.length; i++) {
					const item = JSON.parse(result[i].procData);
					this.recordsList.push({
						sbName: item.sbName,
						sbIdcard: item.sbIdcard,
						sbSex: item.sbSex,
						sbPhone: item.sbPhone,
						sbSensus: item.sbSensus,
						procApplyTime: result[i].procApplyTime
					});
				}
			}
		},
		methods: {
			backLastPage () {
				uni.navigateBack({
				    delta: 1
				});
			}
		}
	}
</script>

<style>

</style>